package com.auto.table;

import java.io.Serializable;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;

public class ColumnScriptDO implements Serializable{
	
	/**
	 * 列名
	 */
	private String columnName;
	
	/**
	 * 列注释
	 */
	private String columnComment;
	
	/**
	 * 主键名，主要有只说明是主键
	 */
	private String primaryKeyName;

	/**
	 * 是否自增
	 */
	private boolean autoIncrease = false;
	
	/**
	 * 字段类型
	 */
	private String type;
	
	/**
	 * 字段长度
	 */
	private String length;
	
	/**
	 * 是否可以为空，不能为空
	 */
	private boolean canNull = false;
	
	/**
	 * 默认值
	 */
	private String defaultValue = "";

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getColumnComment() {
		return columnComment;
	}

	public void setColumnComment(String columnComment) {
		this.columnComment = columnComment;
	}

	public String getPrimaryKeyName() {
		return primaryKeyName;
	}

	public void setPrimaryKeyName(String primaryKeyName) {
		this.primaryKeyName = primaryKeyName;
	}

	public boolean isAutoIncrease() {
		return autoIncrease;
	}

	public void setAutoIncrease(boolean autoIncrease) {
		this.autoIncrease = autoIncrease;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLength() {
		return length;
	}

	public void setLength(String length) {
		this.length = length;
	}

	public boolean isCanNull() {
		return canNull;
	}

	public void setCanNull(boolean canNull) {
		this.canNull = canNull;
	}

	public String getDefaultValue() {
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	
	@Override
	public String toString() {
		return JSONUtil.toJsonStr(this);
	}
}
